Optimizing multi-hit caching for long tail content

ABSTRACT

Some embodiments provide an optimized multi-hit caching technique that minimizes the performance impact associated with caching of long-tail content while retaining much of the efficiency and minimal overhead associated with first hit caching in determining when to cache content. The optimized multi-hit caching utilizes a modified bloom filter implementation that performs flushing and state rolling to delete indices representing stale content from a bit array used to track hit counts without affecting identification of other content that may be represented with indices overlapping with those representing the stale content. Specifically, a copy of the bit array is stored prior to flushing the bit array so as to avoid losing track of previously requested and cached content when flushing the bit arras and the flushing is performed to remove the bit indices representing stale content from the bit array and to minimize the possibility of a false positive.

CLAIM OF BENEFIT TO RELATED APPLICATIONS

This application is a continuation of United States non-provisionalapplication Ser. No. 13/347,615, entitled “Optimized Multi-Hit Cachingfor Long Tail Content”, filed Jan. 10, 2012. The contents of applicationSer. No. 13/347,615 are hereby incorporated by reference.

TECHNICAL FIELD

The present invention relates to content caching.

BACKGROUND ART

Content delivery networks (CDNs) have greatly improved the way contentis transferred across data networks such as the Internet. One way a CDNaccelerates the delivery of content is to reduce the distance thatcontent travels in order to reach a destination. To do so, the CDNstrategically locates surrogate origin servers, also referred to ascaching servers or edge servers, at various points-of-presence (PoPs)that are geographically proximate to large numbers of end users and theCDN utilizes a traffic management system to route requests for contenthosted by the CDN to the caching server that can optimally deliver therequested content to the requesting end user. As used hereafter optimaldelivery of content refers to the most efficient available means withwhich content can be delivered from a server to an end user machine overa data network. Optimal delivery of content can be quantified in termsof latency, jitter, packet loss, distance, and overall end userexperience.

Determination of the optimal caching server may be based on geographicproximity to the requesting end user as well as other factors such asload, capacity, and responsiveness of the caching servers. The optimalcaching server delivers the requested content to the requesting end userin a manner that is more efficient than when origin servers of thecontent provider deliver the requested content. For example, a CDN maylocate caching servers in Los Angeles, Dallas, and New York. Thesecaching servers may cache content that is published by a particularcontent provider with an origin server in Miami. When a requesting enduser in San Francisco submits a request for the published content, theCDN will deliver the content from the Los Angeles caching server onbehalf of the content provider as opposed to the much greater distancethat would be required when delivering the content from the originserver in Miami. In this manner, the CDN reduces the latency, jitter,and amount of buffering that is experienced by the requesting end user.The CDN also allows the content provider to offload infrastructurecosts, configuration management, and maintenance to the CDN while beingable to rapidly scale resources as needed. Content providers cantherefore devote more time to the creation of content and less time tothe creation of an infrastructure that delivers the created content tothe end users. As a result of these and other benefits, many differentCDNs are in operation today. Edgecast, Akamai, Limelight, and CDNetworksare some examples of operating CDNs.

CDNs differentiate themselves on the basis of cost and performance. Onearea in which CDNs strive to improve in terms of cost and performance iscaching. However, it is often the case that improved caching performancebegets increased costs. For example, a CDN can deploy additional storageto each of its caching servers at added cost in order to increase theamount of available cache at each of its caching servers. Similarly, theCDN can deploy more expensive solid state disks (SSDs) in its cachingservers instead of cheaper magnetic disk in order to improveresponsiveness of its caching servers.

To avoid these tradeoffs in cost and performance, CDNs and other cacheoperators are continually in search of new caching techniques, devices,etc. that improve caching performance without added cost. One such areaof focus is the efficiency with which existing caching servers cachecontent.

CDNs typically utilize first hit caching to determine when to cachecontent. First hit caching has been preferred because of its simplicityand relative good performance. When performing first hit caching, acaching server will retrieve requested content from an origin, pass theretrieved content to the requesting end user, and store the content tolocal cache when the content is requested for the first time. The nexttime that content is requested, the caching server will retrieve andserve the content from its local cache rather than from the origin.

However, first hit caching performance is greatly affected by caching of“long-tail” content. As a result, first hit caching yields suboptimalresource utilization. FIG. 1 illustrates the long-tail distribution ofcontent for purposes of explaining its impact on first hit caching.

In FIG. 1, the x-axis represents content that is requested at a cachingserver over an interval of time. The y-axis represents the number ofrequests for each item of content during that interval of time. Asshown, some percentage of “hot” content 110 is requested frequently andsome percentage of content, also referred to as the “long-tail” content120, is infrequently requested (i.e., once or a small number of times).A caching server performing first hit caching caches all such contentthe first time it is requested. In so doing, caching servers with scarcecache availability may replace hot content with long-tail content incache. This in turn increases cache miss rates. This issue can beresolved with added cost to the caching server operator by increasingthe available storage at each cache server. Doing so however introducesother inefficiencies and performance degradations that result fromcaching of long-tail content. Specifically, long-tail content is rarely,if ever, served from cache. Consequently, a caching server wastesresource intensive write operations to cache long-tail content and topurge long-tail content from cache when the content expires. Suchextraneous write operations could potentially degrade the responsivenessof the caching server by introducing delay when having to respond toother operations. Such extraneous write operations reduce the ability ofthe caching server to handle greater loads. Such extraneous writeoperations also reduce the useful life for the storage hardware at thecaching server. Specifically, magnetic disk drives are more likely tosuffer mechanical failure sooner and SSDs are more likely to suffer fromfailing memory cells sooner when performing the extraneous writesassociated with caching the long-tail content. Further still, increaseddisk fragmentation results at the caching server because of theadditional writing and purging of the long-tail content. Such diskfragmentation has been shown to slow access to content and therebydegrade caching performance.

To avoid these and other shortcomings associated with first hit cachingand, more specifically, the shortcomings associated with cachinglong-tail content, some CDNs have utilized second hit caching ormulti-hit caching that cache content when it is requested two or moretimes. This avoids caching some of the long-tail content that isrequested only once or a few times. However, these multi-hit cachingtechniques suffer from other shortcomings that reintroduce the tradeoffbetween performance and cost. Some such shortcomings include increasedprocessor and memory overhead needed to track content request counts, totrack when to cache content, and to track what content has been cached.For example, some existing multi-hit caching techniques store theuniform resource locators (URLs) or textual names of the content beingrequested in conjunction with the number of times that content isrequested, thereby imposing onerous memory overhead. As another example,some existing multi-hit caching techniques identify whether content iscached or has been previously requested one or more times with a sortedlist or similar structure where the searching of such a structureimposes log(n) complexity and onerous processing overhead as a result.These inefficiencies and overhead increase latency, access times, andoverall responsiveness of the caching server, thus offsetting theperformance gains that are realized from avoiding caching long-tailcontent.

Moreover, some second hit caching or multi-hit caching techniques imposeadded cost in the form of infrastructure modifications and additionsthat are needed to maintain content request counts and where content iscached. For example, United State Patent Publication 2010/0332595entitled “Handling Long-Tail Content in a Content Delivery Network(CDN)” introduces a new server, referred to as a popularity server, intoexisting infrastructure to track the number of times content isrequested. In addition to the added costs for deploying and maintainingthe popularity server, the centralized framework also introducesperformance reducing delay as a result of the communication that occursbetween the caching servers and the popularity server.

Accordingly, there is a need to improve CDN performance withoutincreased cost. One specific area of need is to improve cacheperformance without increasing cost and without offsetting other areasof performance. Specifically, there is a need for an optimized multi-hitcaching technique that avoids the performance impact that long-tailcontent has on cache performance while still achieving similarperformance as first hit caching in terms of identifying what content tocache and identifying whether content is cached.

SUMMARY OF THE INVENTION

It is an object of the embodiments described herein to provide anoptimized multi-hit caching technique. More specifically, it is anobject to minimize the effect of long-tail content on cache performancewhile retaining much of the efficiency and minimal overhead that isassociated with first hit caching in determining when to cache contentand in determining which content has been cached. Stated differently, itis an object to minimize the performance impact associated with cachingof long-tail content without imposing onerous processing and memoryoverhead to track and identify content request counts and cachedcontent. In satisfying these objects, it is an object to reduce (whencompared to first hit caching techniques) the number of writes andpurges that are performed by the caching server, thereby (1) extendingthe life of the computer readable storage medium of the caching server,(2) improving latency and access times of the caching server by freeingthe caching server from performing extraneous write and purgeoperations, (3) reducing the amount of storage needed at the cachingserver to maintain a sufficiently high cache hit rate and a sufficientlylow cache miss rate, and (4) reducing the disk defragmentation thatoccurs at the caching server. The optimized multi-hit caching techniqueis intended for execution by caching servers operating in a distributedenvironment such as a content delivery network (CDN) whereby each of thecaching servers of the CDN can perform the optimized multi-hit cachingindependently without a centralized framework. It should be apparentthat the optimized multi-hit caching technique is also applicable to anyserver that performs caching in an intranet, wide area network (WAN),internet, or with other communicably coupled set of networked devices.

In some embodiments, the optimized multi-hit caching technique performsN-hit caching whereby content is cached to a computer readable storagemedium of a caching server when that content is requested N times,wherein N is an integer value greater than one. In some embodiments, theoptimized multi-hit caching technique efficiently tracks the number ofrequests using N−1 bit arrays when performing N-hit caching. In someembodiments, the optimized multi-hit caching technique is intervalrestricted such that content is cached when the requisite number ofrequests for that content is received within a particular specifiedinterval. Such N-hit interval restricted caching avoids much of theperformance impact that is associated with caching of long-tail content,where long-tail content is content that is requested less than N timesduring the particular specified interval. The performance impactassociated with caching long-tail content includes (1) greaterutilization of the computer readable storage medium therebynecessitating that each caching server be deployed with a larger storagemedium or be subject to greater thrashing (content replacement), (2)increased load on the caching server as a result of having to performadditional write and purge operations to cache the long-tail content,(3) less uptime for the caching server as the storage medium of thecaching server is more likely to suffer failure because of greaterutilization, and (4) decreased performance for the caching server as aresult of greater disk fragmentation.

To simplify the discussion, the optimized multi-hit caching techniquewill be described by example of a second hit caching implementation thatis interval restricted. To efficiently implement such second hit cachingand avoid much of the processing and memory overhead associated withtracking the number of times content has been requested and performingthe lookup associated therewith, some embodiments utilize hashing inconjunction with a single-bit bit array or bitmap. For an N-hitimplementation of the optimized caching technique, N−1 bit arrays may beused.

In some embodiments, the optimized caching technique is performed when arequest for content (i.e., content request) is received at a cachingserver. A lookup in cache determines if the requested content is alreadycached. If so, the content is served from cache. Otherwise, hashing isperformed to convert an identifier that is extract from the contentrequest (e.g., filename, URL, etc.) into a set of bit indices thatuniquely identify the content request according to the positions of theproduced bit indices in the bit array. More specifically, the cachingserver extracts from the content request an identifier for identifyingthe content being requested. The caching server uses the extractedidentifier as input to each hash function of a set of hash functions.Each hash function produces an index at a particular position of the bitarray and the collective set of produced indices and their correspondingpositions in the bit array uniquely represent the content beingrequested. Each produced index is then compared with indices previouslyentered in the bit array. When the corresponding bit array indicesrepresenting the requested content are not set in the bit array, the bitarray identifies the content request as the first request or first hitfor such content. Accordingly, the requested content is retrieved froman origin and served to the requestor without caching to avoid cachingon the first hit. The bit array indices representing the requestedcontent are also populated in the bit array to record the first hit forsuch content. When the corresponding bit array indices representing therequested content are already set in the bit array, the requestedcontent is retrieved from an origin, forwarded to the requestor, andcached as the current request will be indicative of the second requestor second hit for the content. In some embodiments, a second bit arrayis used in conjunction with second hit caching to efficiently performthe lookup in cache.

As noted above, the optimized multi-hit caching is interval restrictedin some embodiments to further mitigate the performance impact that isassociated with caching long tail content. This is because intraditional multi-hit caching techniques that are not intervalrestricted, the Nth hit to cache the long-tail content is an eventualityand given an infinite duration, such traditional multi-hit cachingtechniques will receive the Nth request for the long-tail content andtherefore cache the long-tail content. By restricting the interval withwhich the requisite Nth hit occurs before caching content, theeffectiveness of multi-hit caching in avoiding the performance impactassociated with long-tail content is increased. Specifically, themulti-hit caching is optimized to define long-tail content in terms ofat least two dimensions that include 1) a requisite number of N hits and2) a particular specified duration. For example, given a ten secondinterval and second-hit caching, the optimized multi-hit cachingtechnique caches content that is requested at least twice during aparticular ten second interval. Content that is requested less than twotimes in each ten second interval is considered long-tail content. Torestrict the interval for the optimized multi-hit caching technique,some embodiments flush or clear the bit array at periodic intervals orupon defined events.

Using the bit indices to represent requested content eliminates much ofthe onerous memory overhead that is associated with storing URLs,filenames, or other identifiers for the requested content. The bit arrayin conjunction with the bit array indices representing requested contentallows the hit count for all content requests to be tracked using asingle fixed sized storage structure. Moreover, hashing enablessearching of the bit array in constant time to determine if requestedcontent has not yet been requested or has been requested at least once.

The hashing and bit array are consistent with a standard bloom filterimplementation. However, the standard bloom filter is not suited forpurposes of content caching. This is because the standard bloom filter,or more specifically the array of the standard bloom filter, does notprovide functionality to remove indices representing one particularpiece of content from the array without affecting identification ofother content that may be represented with one or more indicesoverlapping with the indices representing the particular piece ofcontent. As the array of the standard bloom filter is continuallypopulated with new indices and stale indices are not removed, the ratioof false positives increases, thereby lessening the accuracy andeffectiveness with which the standard bloom filter identifies contentrequest counts over time. Furthermore, simply flushing the array of thestandard bloom filter causes request counts for relevant or activelymonitored content to be lost in addition to request counts for stale orexpired content. This loss of information can lead to N+1 hit cachingwhen N-hit caching is being performed.

Accordingly to perform the optimized multi-hit caching using a set ofhash functions with at least one bit array that is interval restrictedand periodically flushed, some embodiments implement a proprietarymodified bloom filter. The modified bloom filter, also referred to as arolling flushed bloom filter, stores a copy of the bit array prior toflushing or clearing each of the indices of the bit array at specifiedintervals. A copy of the bit array is made to avoid losing track ofcontent that was requested during the previous interval. In some suchembodiments, the bit indices representing requested content are thuscompared against a previous copied state of the bit array and a currentstate of the bit array (1) to avoid caching of long-tail content that isnot requested a requisite number of times during the previous andcurrent intervals, (2) to ensure the effectiveness of the bit array inaccurately representing content request counts by reducing thepossibility of a false positive by flushing stale bit indicesrepresenting long-tail content from the bit array, and (3) to avoid thepotential for N+1 hit caching.

Some embodiments of the optimized multi-hit caching technique furtherincorporate tiered caching to negate the load increase that an originwould otherwise experience when performing N-hit caching in place offirst hit caching. The optimized multi-hit caching with tiered cachinguses a first cache tier that performs the optimized multi-hit cachingusing the modified bloom filter and a second cache tier that performsfirst hit caching. In this manner, optimized multi-hit caching isperformed to avoid the performance impact of long-tail content with theload to the origin being the same as what the origin would experience ifonly first hit caching was performed.

BRIEF DESCRIPTION OF THE DRAWINGS

In order to achieve a better understanding of the nature of the presentinvention, preferred embodiments for multi-hit caching will now bedescribed, by way of example only, with reference to the accompanyingdrawings in which:

FIG. 1 illustrates the long-tail distribution of content for purposes ofexplaining its impact on first hit caching.

FIG. 2 presents an exemplary CDN infrastructure.

FIG. 3 illustrates components for a caching server that is enhanced toperform the optimized multi-hit caching in accordance with someembodiments.

FIG. 4 presents a process executed by the caching server when performingthe optimized multi-hit caching using the set of hashing functions andthe bit arrays of the optimized multi-hit cache module in accordancewith some embodiments.

FIG. 5 conceptually illustrates how false positives can result whenusing standard bloom filters.

FIG. 6 conceptually illustrates state rolling in conjunction with bitarray flushing in accordance with some embodiments.

FIG. 7 presents a process for performing the optimized multi-hit cachingtechnique with bit array flushing and state rolling in accordance withsome embodiments.

FIG. 8 conceptually illustrates using N−1 bit arrays to performoptimized N-hit caching in accordance with some embodiments.

FIG. 9 illustrates the optimized multi-hit caching when using tieredcaching in conjunction with the modified bloom filter performingflushing and state rolling in accordance with some embodiments.

FIG. 10 illustrates a distributed platform of a CDN having multiplefirst cache tiers and second cache tiers in accordance with someembodiments.

FIG. 11 illustrates the difference in disk utilization for a cachingserver when performing traditional first hit caching and when performingthe optimized multi-hit caching in accordance with some embodiments.

FIG. 12 illustrates the difference in cache header writes for a cachingserver when performing traditional first hit caching and when performingthe optimized multi-hit caching using the rolling flushed bloom filterin accordance with some embodiments.

FIG. 13 illustrates the difference in disk input/output (I/O) for acaching server when performing traditional first hit caching and whenperforming the optimized multi-hit caching in accordance with someembodiments.

FIG. 14 illustrates a computer system or server with which someembodiments are implemented.

DETAILED DESCRIPTION

In the following detailed description, numerous details, examples, andembodiments for systems and methods for optimized multi-hit caching areset forth and described. As one skilled in the art would understand inlight of the present description, these systems and methods are notlimited to the embodiments set forth, and these systems and methods maybe practiced without some of the specific details and examplesdiscussed. Also, reference is made to the accompanying figures, whichillustrate specific embodiments in which the systems and methods can bepracticed. It is to be understood that other embodiments can be used andstructural changes can be made without departing from the scope of theembodiments herein described.

To aid in the discussion below, an overview for a distributedenvironment in which multi-hit caching is to be performed is presentedin FIG. 2. FIG. 2 presents an exemplary CDN infrastructure that includesa distributed set of caching servers 210, traffic management servers220, and an administrative server 230. The figure also illustrates theinteractions that CDN customers including content providers have withthe CDN and interactions that content consumers or end users have withthe CDN.

Each caching server of the set of caching servers 210 may represent asingle physical machine or a cluster of machines that serves content onbehalf of different content providers to end users. The cluster ofmachines may include a server farm for a geographically proximate set ofphysically separate machines or a set of virtual machines that executeover partitioned sets of resources of one or more physically separatemachines. The set of caching servers 210 are distributed acrossdifferent edge regions of the Internet to facilitate the “last mile”delivery of content. Each cluster of servers at a particular region mayrepresent a point-of-presence (PoP) of the CDN, wherein an end user istypically routed to the closest PoP in order to download content fromthe CDN with the goal of reducing the time needed to deliver the contentto the end user. Each caching server of the set of caching servers 210may independently execute the optimized multi-hit caching techniquedescribed below in order to determine when and what content to cache.Each caching server may further execute one or more cache replacementpolicies to determine when to purge cached content. Execution of theoptimized multi-hit caching technique may also be performed at the PoPlevel, whereby each of the subset of caching servers operating in thePoP collectively performs the optimized multi-hit caching technique.

The traffic management servers 220 route end users, and morespecifically, end user issued requests for content to the one or morecaching servers. Different CDN implementations utilize different trafficmanagement schemes to achieve such routing to the optimal cachingservers. As one example, the traffic management scheme performs Anycastrouting to identify a server from the set of servers 210 that canoptimally serve requested content to a particular end user requestingthe content. It should be apparent that the traffic management servers220 can include different combinations of Domain Name System (DNS)servers, load balancers, and routers performing Anycast or BorderGateway Protocol (BGP) routing.

The administrative server 230 may include a central server of the CDN ora distributed set of interoperating servers that perform theconfiguration control and reporting functionality of the CDN. Contentproviders register with the administrative server 230 in order to accessservices and functionality of the CDN. Accordingly, content providersare also referred to as customers of the CDN. Once registered, contentproviders can interface with the administrative server 230 to specify aconfiguration, upload content, and view performance reports. Theadministrative server 230 also aggregates statistics data from eachserver of the set of caching servers 210 and processes the statistics toproduce usage and performance reports. From these reports, the contentprovider can better understand the demand for its content, theperformance provided by the CDN in delivering the content provider'scontent, and the need for capacity reallocation, among other uses.

I. Multi-Hit Caching

Some embodiments provide optimized multi-hit caching for a cachingserver to reduce the performance impact that results when cachingcontent that is requested once or infrequently in a specified interval,otherwise referred to as long-tail content (see FIG. 1). In someembodiments, the optimized multi-hit caching is implemented in adistributed fashion such that each caching server performs the optimizedmulti-hit caching without interdependence on other caching servers andwithout the added expense and overhead that is associated with acentralized framework in which a central server tracks content hitcounts, where content is cached, etc. Moreover, the optimized multi-hitcaching is implemented with a processing and memory footprint and accesstimes similar to that of first hit caching techniques. A caching serverexecuting the optimized multi-hit caching can include an independentoperating cache such as a proxy, a caching server of a distributed setof caching servers such as the edge servers of a CDN, or any server thatprovides caching in an intranet, wide area network (WAN), internet, orwith other communicably coupled set of networked devices.

The optimized multi-hit caching technique achieves several advantagesover first hit caching. Firstly, caching capacity at each of the cachingservers running the optimized multi-hit caching technique is effectivelyincreased without altering the physical storage of the caching servers.This result occurs as a result of more efficient allocation of theexisting storage. More specifically, less of the existing storage isconsumed to cache long-tail content that is rarely, if ever, served fromcache. Consequently, the same caching server can be deployed with lessphysical storage or can support caching of more “hot” content. Secondly,the resource utilization of the caching server is reduced making it moreresponsive and able to handle greater loads without added resources.Resource utilization is reduced because the caching server performsfewer resource intensive write operations as a result of not having tocache long-tail content. Resource utilization is also reduced becausethe caching server performs fewer purge operations as a result of nothaving to remove long-tail content from cache upon expiration, purging,or replacement, wherein each removal operation may be as resourceintensive as a write operation. Thirdly, by avoiding the extraneouswrites and purges associated with the caching of long-tail content, theuseful life of the storage medium at the caching server is increased.Specifically, the storage medium is less likely to suffer frommechanical failure or memory errors when it performs fewer write andpurge operations. Consequently, the storage medium has to be replacedless frequently, yielding cost savings and less downtime to the cachingserver operator. These costs savings are of greater value when thestorage medium is a more expensive solid state disk than a lessexpensive magnetic disk. Fourthly, by avoiding the extraneous writes andpurges associated with the caching of long-tail content, the cachingserver is less affected by the performance degradation that results fromdisk fragmentation. Furthermore, these advantages are realized withlittle to no affect in end user perceived performance as only anegligible fraction of end users would receive requested content from anorigin instead of from cache when using the optimized multi-hit cachinginstead of first hit caching.

As will become apparent from the detailed implementation describedbelow, the optimized multi-hit caching technique of the embodimentspresented herein is distinguishable from and preferred to traditionalsecond hit or multi-hit caching techniques. In contrast to othermulti-hit caching techniques, the implementation for the optimizedmulti-hit caching technique requires a minimal memory footprint whichallows the caching server to perform cache management wholly withinfaster main memory. This minimal memory footprint primarily results fromthe ability to determine request counts using a fixed sized bit arraywhen performing second hit caching and N−1 fixed sized bit arrays whenperforming N hit caching. This is in contrast to other multi-hit cachingtechniques that consume large amounts of memory as a result ofcataloging filenames, URLs, and other descriptive information incombination with request counts. Moreover, the optimized multi-hitcaching technique requires minimal processing overhead to encode to andfrom the bit array(s). The optimized multi-hit caching techniqueutilizes hashing in its implementation to achieve constant time lookupsfor cache hit counts from the bit arrays. Specifically, each of the bitarrays can be searched in parallel to perform a constant time hit countlookup irrespective of the number of bit arrays used and on what hitcount caching is to be performed. As a result, the optimized multi-hitcaching technique is able to achieve comparable performance to first hitcaching without suffering from the performance impact that cachinglong-tail content has on first hit caching.

To simplify the discussion to follow, the optimized multi-hit caching isdescribed with reference to an interval restricted second hit cachingimplementation, whereby content is cached at a caching server when it isrequested for a second time in a specified interval. However, it shouldbe apparent that the optimized multi-hit caching can be adapted forinterval restricted N-hit caching, whereby content is cached at acaching server when it is requested for the Nth time in the specifiedinterval. In some embodiments, the specified interval determines when toflush the bit array that tracks content request counts. In someembodiments, the specified interval is determined based on a percentageof bit indices that are set in the bit array or based on a recurringperiod of time. In some embodiments, the caching server operator cancontrol each of the period or trigger for the specified interval and therequisite number of hits before caching content in an interval. Usingthese variables, the caching server operator can control what content isclassified as long-tail content that should not be cached and whatcontent is classified as “hot” content that should be cached.

FIG. 3 illustrates components for a caching server 310 that is enhancedto perform the optimized multi-hit caching in accordance with someembodiments. The caching server 310 includes network interface 320,processor 330, optimized multi-hit caching module 340, and cache storage350. The optimized multi-hit caching module 340 and cache storage 350reside in computer readable storage medium 360 of the caching server310. As will be described below, the computer readable storage medium360 can comprise any one or more of volatile and non-volatile storageincluding random access memory, solid state storage, and magnetic diskstorage.

The network interface 320 is the means with which the caching server 310communicates with other network enabled devices. The network interface320 implements the communication protocols and protocol stacks to enablesuch communication across different networks including intranets, theInternet, wide area networks (WANs), local area networks (LAN), etc. Ina preferred embodiment, the network interface 320 is an Ethernetinterface that sends and receives communications using the IP networkprotocol.

The processor 330 is the decision making component of the caching server310 which performs caching according to the optimized multi-hit cachingmodule 340. The processor 330 may include any commercially availableprocessor such as those manufactured by Intel® or AMD®.

The optimized multi-hit caching module 340 contains computer executableinstructions that when executed by the processor 330 determine when andwhat content to cache. Accordingly, the optimized multi-hit cachingmodule 340 is the component defining operation for the multi-hit cachingtechnique described herein. The optimized multi-hit caching module 340may be stored to the computer readable storage medium 360 and loadedfrom the computer readable storage medium 360 wholly into main memory(not shown) during execution by the processor 330. As conceptuallydepicted, the optimized multi-hit caching module 340 is encoded with aset of hashing functions and at least one bit array to facilitate thetracking of content requests and whether requested content should becached to the cache storage 350. In some embodiments, the optimizedmulti-hit caching module 340 is also encoded with other cachingalgorithms that operate in accordance with the optimized multi-hitcaching technique. Some such caching algorithms include cachereplacement policies, such as the least recently used (LRU) or mostrecently used (MRU) cache replacement policies that control when cachedcontent is to be purged from the cache. The integration of the optimizedmulti-hit caching module 340 with the other components of the cachingserver 310 transform the caching server 310 to a special purpose machinethat performs caching according to the proprietary methods describedherein. Specifically, the integration of the optimized multi-hit cachingmodule 340 causes the caching server 310 to optimally perform multi-hitcaching while avoiding the performance impact associated with caching oflong-tail content.

The cache storage 350 is an allocated section of the computer readablestorage medium 360 that is used to cache content for accelerateddissemination of content to end users. The accelerated dissemination isachieved based on greater geographic proximity between the cachingserver and the requesting end user than between the origin (i.e., sourcecontent provider) and the requesting end user. The accelerateddissemination may also be achieved when the caching server has greaterbandwidth and greater resources to serve the content to the requestingend user than the origin. The content cached to the cache storage 350can include static, dynamic, interactive, and multimedia content. Inother words, the cached content can include web pages, text, audio,images, and video as some examples.

FIG. 4 presents a process 400 executed by the caching server 310 whenperforming the optimized multi-hit caching using the set of hashingfunctions and the bit array of the optimized multi-hit cache module 340in accordance with some embodiments. The process 400 begins when thecaching server receives (at 410) a content request over the networkinterface. The content request may be encoded using any standard orproprietary messaging protocol. As one example, content requests may beencoded as HyperText Transfer Protocol (HTTP) GET requests.

The process parses the content request to extract (at 415) an identifierthat identifies the content being requested. Depending on the format ofthe content request, the identifier may be found in the header of thepacket encapsulating the content request. The identifier may include aname for the content being request (i.e., filename). The identifier mayalternatively or additionally include a full path for the content beingrequest. The full path can include any fully qualified domain name,hyperlink, URL, or other path for the content being requested.

The process scans (at 420) the cache of the caching server to determine(at 425) whether the content being requested has previously been storedto cache. In some embodiments, scanning the cache involves performing adisk access to determine if the content is stored to the computerreadable storage medium of the caching server.

When the requested content is found in cache, the process passes (at430) the requested content from cache to the requesting end user.Otherwise, the process inputs (at 435) the extracted identifier intoeach hashing function of the set of hashing functions. Each hashingfunction produces an index and position for the bit array, where thecollective set of bit array positions of the produced indices representthe content in an encoded format. The process then compares (at 440) thebit array positions of the resulting indices with the corresponding bitarray positions of the bit array to determine (at 445) if the contentcurrently being requested was requested at least once before.

When one or more of the bit array positions for the hash functionproduced indices are not set in the bit array, it is an indication thatthe content being requested was not requested at least once before.Accordingly, the process sets (at 450) the bit array positions for theproduced indices in the bit array to record the first hit for therequested content. The process retrieves (at 455) the requested contentfrom the origin and passes (at 460) the retrieved content to therequesting end user.

When all of the bit array positions for the hash function producedindices are set in the bit array, it is an indication that the contentbeing requested was requested at least once before. In such cases, theprocess retrieves (at 470) the requested content from the origin, passes(at 480) the retrieved content from the origin to the requesting enduser, and caches (at 485) the content to cache storage so that futurerequests for the same content can be satisfied from cache withoutaccessing the origin.

As will be appreciated by one of ordinary skill in the art, the originrepresents one or more network enabled servers that store a copy of therequested content. The origin servers may be operated by contentproviders that originate such content. The origin servers mayalternatively be operated by any third party that hosts content onbehalf of such content providers. Furthermore, in some embodiments, theprocess hashes the identifier associated with the requested contentbefore scanning the cache to determine whether the content beingrequested has been stored to cache. In some such embodiments, theoptimized multi-hit caching technique utilizes a second bit array totrack whether content has been requested at least twice and is thereforestored to cache. When using a second bit array, the lookup to cache canbe performed by comparing the bit indices representing the requestedcontent with the corresponding positions of the second bit array.

The second hit caching performed by process 400 is efficientlyimplemented because of the relatively low memory requirements needed tostore the fixed size single-bit bit array and the little processingoverhead and constant time needed to perform and resolve the hashing inorder to determine whether content was requested at least once before.Process 400 avoids the performance impact that is associated withcaching long-tail content, and more specifically, the performance impactthat is associated with caching content that is requested once. Theoptimized multi-hit caching can be modified with N−1 bit arrays toperform N-hit caching to avoid the performance impact that is associatedwith caching long-tail content that is requested less than N times.

However, given a sufficiently long or infinite duration of time, it isreasonable to expect that all hosted content will be requested N timesand will therefore be cached. Accordingly in some embodiments, theoptimized multi-hit caching technique is interval restricted such thatcontent is cached when the requisite number of requests for that contentis received within a particular specified interval (i.e., N hits forN-hit caching). By altering this interval and by setting the N-hit countvalue, the caching server operator can control how much content isdiscarded as long-tail content and how much content is cached as “hot”content. For example, the caching server operator can set the optimizedmulti-hit caching to perform second hit caching in a ten secondinterval. In this example, content that is requested twice within theten second interval is classified as “hot” content that should be cachedand content that is not requested at least twice within the ten secondinterval is classified as long-tail content that should not be cached.By restricting the interval, the optimized multi-hit caching techniqueefficiently adapts second hit caching (e.g., with minimal processing andmemory overhead) to avoid the performance impact that is associated withcaching long-tail content, wherein the long-tail content is defined toinclude content that is requested less than two times in the specifiedinterval. More generally, by restricting the interval and N-hit countrequired for caching, the optimized multi-hit caching techniqueefficiently avoids the performance impact that is associated withcaching long-tail content, wherein the long-tail content is customdefined by the caching server operator according to at least twodimensions: 1) the specified number of N-hits and 2) the duration forthe specified interval in which the N-hits are to occur in order tocache content.

To facilitate the discussion for implementing the interval restrictedmulti-hit caching technique, an introduction to bloom filters is nowprovided. Specifically, the above described hashing functions and bitarray are consistent with those used to implement a standard bloomfilter. As is well known in the art, a bloom filter guarantees that nofalse negatives will be identified. However, there is a slightprobability for a false positive. A false negative identifies that anelement is not within a set when the element is actually in the set. Afalse positive identifies that an element is within a set when theelement is actually not in the set. When applied to caching, a falsepositive in the bit array falsely identifies that a particular item ofcontent was requested at least once when in actuality it had not beenrequested. Such a false positive can therefore lead to falselyidentifying that content should be cached.

FIG. 5 conceptually illustrates how false positives can result whenusing standard bloom filters. The figure illustrates a first stage 505,a second stage 515, and a third stage 525. The false positive occurs inthe third stage 525.

As shown at 505, a first content identifier 510, “Video 1.flv”, isidentified from a request for a first item of content. The first contentidentifier 510 is hashed by three hash functions to produce indices inthe first, fourth, and seventh positions of the bit array 550 (1001001).The bit array 550 is examined to determine if these bit positions arealready set as an indication as to whether or not the first contentidentifier 510 was previously requested. Since none of the bit positionsin the bit array 550 are set, the bit array 550 correctly identifiesthat the first content identifier 510 has not yet been requested and theproduced indices are set in the bit array 550 to record the first hitfor the first content identifier 510.

As shown at 515, a second content identifier 520, “ImageABC.jpg”, isidentified from a request for a second item of content. The secondcontent identifier 520 is hashed by the three hash functions to produceindices in the second, third, and seventh positions of the bit array 550(0110001). The bit array 550 is examined to determine if these bitpositions are already set as an indication as to whether or not thesecond content identifier 520 was previously requested. Since at leastone of the positions (i.e., second and third bit positions) in the bitarray 550 is not set, the bit array 550 correctly identifies that thesecond content identifier 510 has not yet been requested and theproduced indices are set in the bit array 550 to record the first hitfor the second content identifier 520

As shown at 525, a third content identifier 530, “Web_A1.html”, isidentified from a request for a third item of content. The third contentidentifier 530 is hashed by the three hash functions to produce indicesin the first, second, and third positions of the bit array 550(1110000). The bit array 550 is examined to determine if these bitpositions are already set as an indication as to whether or not thethird content identifier 520 was previously requested. In this instance,the bit array produces a false positive that incorrectly suggests thatthe third content identifier 530 was previously requested. The falsepositive occurs due to the index representations for the first andsecond content identifiers 510 and 520 overlapping with the indexrepresentation for the third content identifier 530.

The probability of a false positive can be reduced by increasing thesize of the bit array. When used in conjunction with caching content,the optimal size for the bit array is a factor of the quantity ofexpected cacheable content and the number of hashing functions.Specifically, the probability of a false positive is determined usingthe formula:p=(1−e^((−k*n)/m))^k  (1)

In the above formula, p is the probability, k is the number of hashfunctions, m is the number of bits in the array, and n is the number ofinserted elements or quantity of expected cacheable content. A CDN canestimate the value for n based on log analysis over one or more timeseries. Alternatively, a CDN can estimate the value for n based on theamount of content it has contracted to host on behalf of various contentproviders. A second formula can be used to determine the optimal numberof hash functions or the optimal number for k:k=(m*log(2))/n  (2)

However, the standard bloom filter is less than ideal for purposes ofcontent caching. This is because the standard bloom filter, or morespecifically the array of the standard bloom filter, lacks functionalityto remove indices representing one particular piece of content from thebit array without affecting identification of other content that may berepresented with one or more indices overlapping with the indicesrepresenting the particular piece of content. As the array of thestandard bloom filter is continually populated with new indices andstale indices are not removed, the ratio of false positives increases,thereby lessening the accuracy and effectiveness with which the standardbloom filter identifies content request counts over time. For example,with reference to stage 525 of FIG. 5, it is not possible to remove theindices representing the first identifier 510 without removing an index(see the seventh index in the bit array) for each of the secondidentifier 520 and the third identifier 530. A sufficiently high falsepositive probability will incorrectly indicate that certain content waspreviously requested when it was not. This in turn causes the content tobe cached after the first hit. In so doing, the above describedadvantages for performing multi-hit caching using hashing and a bitarray is lost as the multi-hit caching technique effectively revertsback to first hit caching which then reintroduces the performance impactassociated with caching of long-tail content.

These issues may be resolved using a counting bloom filter instead of astandard bloom filter. A counting bloom filter is well known in the artand provides a deletion operation for each bit index of the bit array.Specifically, each index for an array of the counting bloom filter isextended from a single bit to multiple bits. This allows for counting ateach index of the bit array. For example, by incrementing an index countat a particular index of the array, the counting bloom filter can trackoverlapping indices representing different content. The counting bloomfilter also provides a deletion function or a function to decrement acount at a particular index in order to remove indices for first contentwithout disturbing the bit indices representing second content when thebit index representation for the first content has one or moreoverlapping indices with the bit index representation for the secondcontent.

While the counting bloom filter resolves issues with respect to removingbit indices, the counting bloom filter requires X times more memory thana standard bloom filter, where X is the number of bits for each index.This substantial increase in memory overhead may require additionalmemory to be added to the caching servers at additional cost to thecaching server operator or may cause the caching to be performed withinslower secondary memory as opposed to faster main memory. Furthermore,the associated increase in processing overhead to manage the additionalcounting functionality consumes valuable processor cycles of the cachingserver, thereby introducing undesired delay and degrading theresponsiveness and load handling capabilities of the caching server.Accordingly, the counting bloom filter is less than ideal for cachinglarge quantities of content as is the case in a CDN.

II. Multi-Hit Caching Optimizations

A. Flushing with State Rolling

Some embodiments utilize a proprietary modified bloom filter toimplement the interval restricted multi-hit caching in a manner thatretains the memory and processing efficiency associated with a standardbloom filter and in a manner that retains the effectiveness of the bitarray over time without loss of state information, thereby overcomingthe shortcomings of the standard bloom filter and the counting bloomfilter for use in performing content caching. In some embodiments, theproprietary modified bloom filter implementation combines flushing ofthe bloom filter with state rolling. The implementation is hereinafterreferred to as the rolling flushed bloom filter.

Flushing a bit array involves periodically clearing the bit indices ofthe bit array. Clearing the bit array controls the frequency with whicha particular item of content needs to be requested N times in order tobe classified as “hot” content or long-tail content. Stated differently,clearing the bit array controls the frequency with which a particularitem of content needs to be requested N times in order to be cached. Forexample, more content will be classified as long-tail content whenperforming second hit caching using a ten second flushing interval thanwhen performing second hit caching using a one minute interval, becausethe likelihood of content being requested N times for N-hit caching inthe ten second interval is less than the likelihood of content beingrequested N times for N-hit caching in the one minute interval. Flushingalso reduces the potential for identification of a false positive fromthe bit array, thereby increasing or maintaining the effectiveness ofthe bit array in identifying content request counts. In someembodiments, the bit array for the modified bloom filter is flushed atregular intervals or when specified events occur. For example, the bitarray may be flushed at times when the caching server experiences lowload, the caching server invokes a cache replacement policy to expire,purge, or replace content from the cache, or some specified percentageof the bit indices of the bit array is set (e.g., 20% of the bit indicesof the bit array is set).

However, flushing the bit array has the undesired effect of removingcontent request counts for content that is actively being monitored.Accordingly, some embodiments of the optimized multi-hit caching performstate rolling in addition to flushing to allow removal for the bit arrayrepresentations of stale or expired content from the bit arrays whilestill being able to track content request counts for content that isactively being monitored.

State rolling involves retaining the last state of the bit array beforeflushing the bit array and using the previous state in conjunction withthe current state of the bit array to remove bit indices for stale orexpired content without affecting bit indices for actively requestedcontent. In some such embodiments, the interval for the receiving Nrequests to cache content when performing N-hit caching is defined toinclude a current interval and a previous interval, where the currentinterval is represented by the current state of the bit array and theprevious interval is represented by the previous state of the bit array.For example, when performing second hit caching in a ten secondinterval, the previous interval is defined to include the first fiveseconds of the ten second interval and the current interval is definedto include the last five seconds of the ten second interval.Accordingly, content is cached when the content is requested at leasttwice in ten seconds.

FIG. 6 conceptually illustrates state rolling in conjunction with bitarray flushing in accordance with some embodiments. This figureillustrates a previous state 610 and a current state 620 for the bitarray. The previous state 610 tracks content that was requested at leastonce during a previous interval. The current state 620 tracks contentthat was requested at least once during a current interval. As shown,the previous state 610 for the bit array indicates that two items ofcontent were requested during the previous interval including: 1)video1.flv, as represented by bit indices 1000110, and 2) imageABC.jpg,as represented by bit indices 0100101. The current state 620 for the bitarray is flushed to clear the corresponding bit indices at the start ofthe current interval.

Sometime after the start of the current interval, a request is receivedfor the content imageABC.jpg. Accordingly, the bit indices representingthe content (0100101) are compared against the previous state 610 forthe bit array and current state 620 for the bit array to determine ifthe content was requested at least once before during either theprevious interval or current interval. This comparison identifies thatthe content imageABC.jpg was requested during the previous interval, buthas not yet been requested during the current interval. This then is anindication that the current request is the second request for thecontent during the specified interval in which case the content isretrieved from the origin, passed to the requesting end user, and storedto cache (when performing second hit caching). In some embodiments, thebit indices representing imageABC.jpg are also set in the current state620 for the bit array to refresh the first hit for that item of contentin the current interval. By updating the current state 610 of the bitarray, the count for imageABC.jpg is entered into the current intervalwhich causes the count to be carried over into at least one subsequentinterval.

FIG. 6 also illustrates how flushing with state rolling allows removalof the bit indices representing a first item of content that overlapwith the bit indices representing a second item of content withoutaffecting the bit indices for the second item of content. In thisfigure, video1.flv is not requested during the current interval. The bitindices representing video1.flv are therefore not refreshed in thecurrent state 620 of the bit array though they are present in theprevious state 610 of the bit array. Accordingly, should video1.flv berequested again in the next interval (i.e., the interval after thecurrent interval), the bit indices representing video1.flv will not bepresent in the previous state or current state of the bit array at thenext interval and the request in the next interval will be treated asthe first request for that content. It should also be noted that the bitindices representing content imageABC.jpg are unaffected by the removalof the bit indices representing content video1.flv in the current state620 for the bit array even though the bit indices for the differentcontent overlap at the fifth index position. This is because the bitindices representing content imageABC.jpg are reentered after clearingthe current state 620 for the bit array, while the bit indicesrepresenting content video1.flv are not reentered after clearing thecurrent state 620 for the bit array.

State rolling has the further advantage of eliminating the potential forN+1 hit caching from occurring. For example, a particular item ofcontent is requested once during a first interval and the hit count isentered to the current state of the bit array for the first interval.Between the first interval and a second interval, the state of the bitarray is copied for the previous state and the bit array is flushed forthe current state. During the second interval, the particular item ofcontent is requested a second time. Due to the flushing that occurredbetween the first and second intervals, the hit count that occurredduring the first interval is lost in the current state of bit array (forthe second interval). However, the hit count is still retained in theprevious state of the bit array and that information can be used todetermine that the particular item of content has been requested oncebefore and need not be requested again (i.e., a third time) in order tocache the content when performing second hit caching.

FIG. 7 presents a process 700 for performing the optimized multi-hitcaching technique with bit array flushing and state rolling inaccordance with some embodiments. The process 700 is performed when acontent request is received. The process extracts (at 705) an identifierfor identifying the requested content from the request. The processscans (at 710) the cache to determine whether the content beingrequested is cached.

When the requested content is found in cache, the process passes (at715) the requested content from cache to the requesting end user.Otherwise, the extracted identifier is input into the set of hashingfunctions to produce (at 720) bit array indices that represent thecontent being requested. The process determines (at 730) whether theproduced indices are set in the current state for the bit array.

When the produced indices are set in the current state for the bitarray, the content has already been requested at least once during thecurrent interval and the current request is the second request for thecontent. Accordingly when performing interval restricted second hitcaching, the process retrieves (at 740) the requested content from theproper origin, passes (at 745) the retrieved content from the origin tothe requesting end user, and caches (at 750) the content to cachestorage so that future requests for the same content are served fromcache.

When the process determines (at 730) that the indices have not alreadybeen set in the current state for the bit array, the process determines(at 760) whether the indices are set in the previous state for the bitarray. In some embodiments, the determinations performed at steps 730and 760 are performed in parallel instead of the sequential steps ofprocess 700.

When the indices have not been set in either the current state for thebit array or the previous state for the bit array, the process sets (at770) the indices in the current state for the bit array, retrieves (at775) the requested content from the proper origin, and passes (at 780)the retrieved content to the requesting end user.

When the indices are set in the previous state, the current request isthen a second request for the content within the restricted interval.Accordingly, the process retrieves (at 740) the requested content fromthe proper origin, passes (at 745) the retrieved content from the properorigin, and caches (at 750) the content to cache storage so that futurerequests for the same content are served from cache.

B. Optimized N−1 Hit Caching

As was noted above, the optimized multi-hit caching technique can beadapted to perform N-hit caching, where N is an integer value that isgreater than one. In some such embodiments, the optimized multi-hitcaching technique is implemented using N−1 bit arrays to performoptimized N-hit caching. Each bit array is associated with a specifichit count of the N-hit caching progression. Collectively, the N−1 bitarrays identify the hit count for particular content and whether theparticular content should be cached. For example, a first bit array ofthe N−1 bit arrays tracks whether content is requested once, a secondbit array of the N−1 bit arrays tracks whether content is requestedtwice, etc. Therefore to increment a hit count for particular contentfrom zero to one, the bit indices representing the particular contentare set in the first bit array of the N−1 bit arrays and to increment ahit count for the particular content from one to two, the bit indicesrepresenting the particular content are set in the second bit array ofthe N−1 bit arrays. When the bit indices representing particular contentare set in each bit array of the N−1 bit arrays, then the next requestfor the particular content will be indicative of the Nth hit andtherefore result in the particular content being cached. The lookup intothe bit arrays to determine a hit count can be performed in serial or inparallel. The lookup can be performed in parallel because each bit arrayof the N−1 bit arrays represents a specific hit count. Therefore, whenindices representing particular content are set in some but not all ofthe N−1 bit arrays, the bit array that includes the indices and isrepresentative of the highest hit count will be used to determine thehit count for the particular content.

FIG. 8 conceptually illustrates using N−1 bit arrays to performoptimized N-hit caching in accordance with some embodiments. Forpurposes of simplicity, FIG. 8 described performing N-hit caching usingN−1 bit arrays while omitting discussion related to rolling and flushingof the bit N−1 bit arrays.

FIG. 8 illustrates performing third hit caching using two bit arrays 810and 820. The first bit array 810 tracks content that has been requestedat least once. The second bit array 820 tracks content that has beenrequested at least twice. The figure also illustrates cache 830 of thecaching server. For purposes of simplicity, the figure is illustratesover four stages 840, 850, 860, and 870 of a particular interval.

At stage 840, a request is received for content “ABC.html”. A check ismade to the cache 830 to determine if the content is cached. At stage840, the content has not been cache as the received request is the firstrequest for the content during the interval. The bit indexrepresentation for ABC.html is produced using the set of hash functions.To optimize the request count lookup for content ABC.html, the hashfunction produced indices are simultaneously compared against the bitindices of the first bit array 810 and the second bit array 820. The bitarrays identify that the content has not yet been requested.Accordingly, the bit indices representing content ABC.html are enteredin the first bit array 810.

At stage 850, a second request for content ABC.html is received. Again,a check is made to the cache 830 to reveal that the content is not yetcached and the hash function produced indices are simultaneouslycompared against the bit indices of the first bit array 810 and thesecond bit array 820. At stage 850, the first bit array 810 identifiesthat the content has been requested once and the second bit array 820identifies that the content has not been requested twice. Accordingly,the bit indices representing content ABC.html are entered in the secondbit array 820 to record the second hit.

At stage 860, a third request for content ABC.html is received. A checkis made to the cache 830 to reveal that the content is not yet cachedand the hash function produced indices are simultaneously comparedagainst the bit indices of the first bit array 810 and the second bitarray 820 to identify that the content has been requested at least twicebefore. Accordingly, the content is retrieved from the proper origin,stored to the cache 830, and passed to the requesting end user.

At stage 870, a fourth request for content ABC.html is received. A checkis made to the cache 830 to reveal that the content is cached.Accordingly, the content is served to the requesting end user from cachewithout further access to the origin.

By simultaneously comparing the hash function produced indices with eachof the N−1 bit arrays, the optimized multi-hit caching technique is ableto identify content request counts in constant time and in the sameamount of time needed to check a single bit array.

C. Origin Shield

An undesired effect of any multi-hit (e.g., two or more hit) cachingtechnique is the increased load on each origin. There is approximately a50% load increase on the origin when performing second hit caching andthere is approximately an 80% load increase on the origin whenperforming third hit caching. Specifically, a caching server performingfirst hit caching retrieves content once from an origin, after which thecontent is cached at the caching server. A caching server performingsecond hit caching retrieves the same content from an origin after thefirst hit and after the second hit. Only after the second hit does thecaching server performing second hit caching cache the content. In adistributed environment, this increased load is further exacerbated bythe number of caching servers that retrieve content from the origin.

To mitigate the impact that multi-hit caching has on an origin, theoptimized multi-hit caching technique of some embodiments is performedusing tiered caching in conjunction with the modified bloom filterperforming flushing and state rolling. In some such embodiments, thecaching servers are hierarchically ordered to provide at least a firstcache tier and a second cache tier between the requesting end user andthe origin. Caching servers at the first cache tier receive contentrequests from the end users and utilize the modified bloom filter todetermine if the requested content is cached or whether to cache therequested content. The second cache tier, also referred to as the originshield, is positioned in between the first cache tier and one or moreorigin servers. The caching servers at the second cache tier performfirst hit caching. This tiered caching in conjunction with the modifiedbloom filter, allows the caching server operator to achieve theadvantages that are associated with avoiding caching of long-tailcontent while retaining the minimal processing and memory overhead thatis associated with a bloom filter for tracking content request countsand cached content.

FIG. 9 illustrates the optimized multi-hit caching when using tieredcaching in conjunction with the modified bloom filter performingflushing and state rolling in accordance with some embodiments. Thefigure depicts a content requesting end user 910, a first cache tier920, a second cache tier 930 operating as the origin shield, and anorigin 940. The end user 910 may be representative of one or more enduser devices that request particular content generated by the origin940. The first cache tier 920 and second cache tier 930 may eachcomprise one or more caching servers that are operated by a CDN. The oneor more caching servers of the first cache tier 920 may begeographically distributed to form different PoPs of the CDN or may belocated in a single PoP of the CDN. The one or more caching servers ofthe second cache tier 930 may be communicably coupled to multipledifferent first cache tiers 920 or multiple different PoPs of the CDNand may be communicably coupled to multiple different origins eventhough a single origin 940 is depicted in the figure. The origin 940 maycomprise one or more servers that are operated by a content provider.

When an end user 910 submits (at 950) a first request for content of theorigin 940, the request is routed to the first cache tier 920 performingthe above described optimized multi-hit caching using the rollingflushed bloom filter. Based on hashing of the content request and acheck into the bit array, the first cache tier 920 determines (at 955)that the request is the first such request for the content of the origin940. Rather than retrieve the requested content from the origin 940, thefirst cache tier 920 attempts to retrieve the content from the secondcache tier 930. Accordingly, the caching server at the first cache tier920 forwards (at 957) the request to the second cache tier 930.

The second cache tier 930 receives the content request from the firstcache tier 920 and determines (at 960) that the request is the firstsuch request for the content of the origin 940. Since the second cachetier 930 performs first hit caching, the second cache tier 930 forwards(at 965) the request to the origin 940, retrieves (at 967) the contentfrom the origin 940, passes (at 975) the retrieved content to thecaching server at the first cache tier 920, and caches (at 970) theretrieved content. The first cache tier 920 receives the content fromthe second cache tier 930 and passes (at 977) the content to therequesting end user 910.

When an end user 910 submits (at 980) a second request for the samecontent of the origin 940, the request is again routed to the firstcache tier 920. Based on hashing of the content request, a check intothe bit array, and a scan of the cache, the first cache tier 920determines (at 985) that the request is the second such request for thecontent of the origin 940 and that the content is not yet cached at thefirst cache tier 920. Accordingly, the first cache tier 920 passes (at987) the content request to the second cache tier 930. The second cachetier 930 will have cached the requested content based on the previousrequest for the same content and because of the first hit cachingperformed at the second cache tier 930. Consequently, the second cachetier 930 passes (at 990) the requested content from its cache to thefirst cache tier 920. In this manner, the second cache tier 930 shieldsthe origin 940 from serving the content a second time. The first cachetier 920 receives the content from the second cache tier 930 and passes(at 995) the content to the requesting end user 910. Since the contenthas now been requested twice, the first cache tier 920 caches (at 993)the content in cache storage such that subsequent requests for the samecontent of the origin 940 can be served from cache of the first cachetier 910.

In some embodiments, the second cache tier is coupled to and servicesmultiple caching servers at a first cache tier. In this framework,caching servers at a first cache tier comprise a first PoP of a CDN andcaching servers at a second cache tier comprise a second PoP of the CDN.In some embodiments, the second cache tier is coupled to and servicesmultiple caching servers at different first cache tiers. In thisframework, caching servers at different first cache tiers comprisedifferent PoPs of the CDN and caching servers at a second cache tiercomprise a “super-PoP” of the CDN. In some embodiments, the cachingservers of the first and second cache tiers are geographicallycollocated in the same PoP.

FIG. 10 illustrates a distributed platform of a CDN having multiplefirst cache tiers 1010, 1020, 1030, 1040, 1050, and 1060 and secondcache tiers 1070 and 1080 in accordance with some embodiments. As shown,each of the first cache tiers 1010-1060 are geographically proximate toa set of end users to provide optimal delivery of cached content to theend users. Each of the first cache tiers 1010-1060 may include one ormore caching servers depending on the load experienced at thecorresponding geographic region serviced by a particular first cachetier. Each of the first cache tiers 1010-1060 perform the optimizedmulti-hit caching technique according to the rolling flushed bloomfilter described above. Moreover, the first cache tiers 1010-1030 arecommunicably coupled to the second cache tier 1070 and the first cachetiers 1040-1060 are communicably coupled to the second caching tier1080. Furthermore, in some embodiments, each caching server at aparticular first cache tier (e.g., 1010-1060) can perform the optimizedmulti-hit caching technique while being configured to cache on adifferent number of hits or different recurring intervals in which thehits occur in order to cache content.

FIGS. 11-13 present measurements that illustrate the improvements tocache performance when running the optimized multi-hit caching accordingto the rolling flushed bloom filter. FIG. 11 illustrates the differencein disk utilization for a caching server when performing traditionalfirst hit caching and when performing the optimized multi-hit caching inaccordance with some embodiments. The x-axis represents time and morespecifically, an interval spanning different days of a month. The y-axisrepresents percentage of disk utilization over time. During the timeinterval 1110, the caching server performs first hit caching. During thetime interval 1120, the caching server performs the optimized multi-hitcaching using the rolling flushed bloom filter. As can be seen from thedisk utilization rates, the optimized multi-hit caching providesapproximately 20% savings in overall disk utilization when compared totraditional first hit caching. As a result, the caching server is ableto cache at least 20% more “hot” content using the same physical storagethan when performing first hit caching. However, the amount of “hot”content that is stored by the caching server when performing theoptimized multi-hit caching is actually much greater given thatlong-tail content that is requested once is not cached in contrast towhen the caching server performs first hit caching.

FIG. 12 illustrates the difference in cache header writes for a cachingserver when performing traditional first hit caching and when performingthe optimized multi-hit caching using the rolling flushed bloom filterin accordance with some embodiments. The x-axis represents time and morespecifically, an interval spanning different days of a month. The y-axisrepresents the number of cache header writes. The cache header writesrepresent the number of objects that are cached at a particular cachingserver at a given time. During the time interval 1210, the cachingserver performs first hit caching and has an average maximum ofapproximately 18 cache header writes, an average minimum ofapproximately 7 cache header writes, and an average of approximately12.5 cache header writes. During the time interval 1120, the cachingserver performs the optimized multi-hit caching using the rollingflushed bloom filter. For the time interval 1120, the caching server hasan average maximum of approximately 7 cache header writes, an averageminimum of approximately 3 cache header writes, and an average ofapproximately 5 cache header writes. Consequently, the optimizedmulti-hit caching yields an average 50% savings in cache header writeswhen compared to first hit caching. This improves the responsiveness ofthe caching server as the server performs 50% fewer resource intensivewrite operations. Consequently, the caching server can serve contentfaster and can handle greater loads without expanding the resources ofthe caching server.

FIG. 13 illustrates the difference in disk input/output (I/O) for acaching server when performing traditional first hit caching and whenperforming the optimized multi-hit caching in accordance with someembodiments. The x-axis represents time and more specifically, aninterval spanning different days of a month. The y-axis represents thenumber of disk I/O operations performed where the disk I/O operationsrepresent the percentage of disk I/O usage. During the time interval1310, the caching server performs first hit caching. During the timeinterval 1320, the caching server performs the optimized multi-hitcaching using the rolling flushed bloom filter. As can be seen from thegraphs, the caching server experiences approximately a 66% reduction inthe amount of disk I/O operations that are performed when caching usingthe optimized multi-hit caching than when caching using first hitcaching. This reduction in disk I/O operations improves theresponsiveness of the caching server as the caching server spends fewercycles performing resource intensive disk I/O operations and the storageis less fragmented. This reduction in disk I/O operations furtherimproves uptime of the caching server as the caching server is lesslikely to experience storage failure.

III. Server System

Many of the above-described processes and components are implemented assoftware processes that are specified as a set of instructions recordedon non-transitory computer readable storage medium (also referred to ascomputer readable medium). When these instructions are executed by oneor more computational element(s) (such as processors or othercomputational elements like ASICs and FPGAs), they cause thecomputational element(s) to perform the actions indicated in theinstructions. Server, computer, and computing machine is meant in itsbroadest sense, and can include any electronic device with a processorthat executes instructions stored on computer readable media or that areobtained remotely over a network connection. Examples of computerreadable media include, but are not limited to, CD-ROMs, flash drives,RAM chips, hard drives, EPROMs, etc. Furthermore, wherever a server isidentified as a component of the embodied invention, it is understoodthat the server may be a single physical machine, or a cluster ofmultiple physical machines performing related functions, or virtualizedservers co-resident on a single physical machine, or variouscombinations of the above.

FIG. 14 illustrates a computer system or server with which someembodiments are implemented. Such a computer system includes varioustypes of computer readable mediums and interfaces for various othertypes of computer readable mediums that implement the optimizedmulti-hit caching techniques and modified bloom filter implementationdescribed above. Computer system 1400 includes a bus 1405, a processor1410, a system memory 1415, a read-only memory 1420, a permanent storagedevice 1425, input devices 1430, and output devices 1435.

The bus 1405 collectively represents all system, peripheral, and chipsetbuses that communicatively connect the numerous internal devices of thecomputer system 1400. For instance, the bus 1405 communicativelyconnects the processor 1410 with the read-only memory 1420, the systemmemory 1415, and the permanent storage device 1425. From these variousmemory units, the processor 1410 retrieves instructions to execute anddata to process in order to execute the processes of the invention. Theprocessor 1410 is a processing device such as a central processing unit,integrated circuit, graphical processing unit, etc.

The read-only-memory (ROM) 1420 stores static data and instructions thatare needed by the processor 1410 and other modules of the computersystem. The permanent storage device 1425, on the other hand, is aread-and-write memory device. This device is a non-volatile memory unitthat stores instructions and data even when the computer system 1400 isoff. Some embodiments of the invention use a mass-storage device (suchas a magnetic or optical disk and its corresponding disk drive) as thepermanent storage device 1425.

Other embodiments use a removable storage device (such as a flash drive)as the permanent storage device Like the permanent storage device 1425,the system memory 1415 is a read-and-write memory device. However,unlike storage device 1425, the system memory is a volatileread-and-write memory, such a random access memory (RAM). The systemmemory stores some of the instructions and data that the processor needsat runtime. In some embodiments, the processes are stored in the systemmemory 1415, the permanent storage device 1425, and/or the read-onlymemory 1420.

The bus 1405 also connects to the input and output devices 1430 and1435. The input devices enable the user to communicate information andselect commands to the computer system. The input devices 1430 includealphanumeric keypads (including physical keyboards and touchscreenkeyboards), pointing devices (also called “cursor control devices”). Theinput devices 1430 also include audio input devices (e.g., microphones,MIDI musical instruments, etc.). The output devices 1435 display imagesgenerated by the computer system. The output devices include printersand display devices, such as cathode ray tubes (CRT) or liquid crystaldisplays (LCD).

Finally, as shown in FIG. 14, bus 1405 also couples computer 1400 to anetwork 1465 through a network adapter (not shown). In this manner, thecomputer can be a part of a network of computers (such as a local areanetwork (“LAN”), a wide area network (“WAN”), or an Intranet, or anetwork of networks, such as the internet.

As mentioned above, the computer system 1400 may include one or more ofa variety of different computer-readable media. Some examples of suchcomputer-readable media include RAM, ROM, read-only compact discs(CD-ROM), recordable compact discs (CD-R), rewritable compact discs(CD-RW), read-only digital versatile discs (e.g., DVD-ROM, dual-layerDVD-ROM), a variety of recordable/rewritable DVDs (e.g., DVD-RAM,DVD-RW, DVD+RW, etc.), flash memory (e.g., SD cards, mini-SD cards,micro-SD cards, etc.), magnetic and/or solid state hard drives, ZIP®disks, read-only and recordable blu-ray discs, any other optical ormagnetic media, and floppy disks.

While the invention has been described with reference to numerousspecific details, one of ordinary skill in the art will recognize thatthe invention can be embodied in other specific forms without departingfrom the spirit of the invention. Thus, one of ordinary skill in the artwould understand that the invention is not to be limited by theforegoing illustrative details, but rather is to be defined by theappended claims.

We claim:
 1. A computer-implemented method performed by a caching serverfor N hit caching of content by that caching server, wherein N is aninteger value greater than one, the computer-implemented methodcomprising: configuring the caching server with a first request counterand a second request counter for tracking request counts for a pluralityof content received during different intervals to different sets ofindices of the first and second request counters, wherein each set ofthe different sets of indices uniquely identifies a request count fordifferent content of the plurality of content; using the first requestcounter of the caching server to increment a request count for eachcontent of a plurality of content that is requested during a firstinterval, wherein the first request counter tracks M requests receivedfor a specific item of content of the plurality of content during thefirst interval to a particular set of indices, wherein M is an integervalue that is less than N; resetting the first request counter at theend of the first interval, said resetting comprising (i) copying therequest count tracked to the particular set of indices of the firstrequest counter to the second request counter and (ii) clearing requestcounts of the first request counter; receiving at the caching server, anew request for the specific item of content during a second intervalthat immediately follows the first interval; incrementing the particularset of indices of the first request counter to track the new request forthe specific item of content that is received during the secondinterval; determining a cumulative request count for the specific itemof content based on the M requests from the first interval that werecopied to the particular set of indices of the second request counterand at least the new request that is tracked to the particular set ofindices of the first request counter during the second interval; passingthe specific item of content from an origin and caching it at thecaching server when the cumulative request count for the specific itemof content identifies N requests; and passing the specific item ofcontent from an origin without caching it at the caching server when thecumulative request count for the specific item of content identifiesfewer than N requests.
 2. The computer-implemented method of claim 1,wherein resetting the first request counter at the end of the firstinterval zeros request counts for any content that was requested in aninterval immediately prior to the first interval but that was notrequested during the first interval.
 3. The computer-implemented methodof claim 1, wherein the specific item of content is first content of theplurality of content, the particular set of indices is a first set ofindices, and wherein the first request counter tracks X requestsreceived for second content of the plurality of content during the firstinterval to a second set of indices, wherein X is an integer value. 4.The computer-implemented method of claim 3 further comprising resettingthe first request counter at the end of the second interval by (i)copying request counts tracked to the first and second sets of indicesof the first request counter to the second request counter and (ii)clearing the first request counter.
 5. The computer-implemented methodof claim 4 further comprising receiving a new request for the secondcontent during a third interval that immediately follows the secondinterval.
 6. The computer-implemented method of claim 5 furthercomprising incrementing the second set of indices of the first requestcounter to specify a first request for the second content based on zerorequests tracked to the first and second request counters as a result of(i) not receiving a request for the second content during the secondinterval and (ii) resetting the first request counter at the end of thesecond interval.
 7. The computer-implemented method of claim 1 furthercomprising querying cache of the caching server to determine whether thespecific item of content is cached at the caching server.
 8. Thecomputer-implemented method of claim 7 further comprising passing thespecific item of content from cache when the cumulative request countfor the specific item of content identifies N+1 requests.
 9. Acomputer-implemented method providing second hit content caching at acaching server comprising a processor and non-transitorycomputer-readable storage, the computer-implemented method comprising:tracking by operation of the processor, requests for a first set ofcontent received during a first interval as different sets of indicesentered to a first array on the non-transitory computer-readablestorage, wherein each set of indices of the different sets of indicesuniquely identifies different content of the first set of content;copying by operation of the processor, the different sets of indicesentered to the first array to a second array on the non-transitorycomputer-readable storage at the end of the first interval; clearing thefirst array at the end of the first interval by operation of theprocessor; tracking by operation of the processor, requests for a secondset of content received during a second interval that commences at theend of the first interval by entering a different set of indicesuniquely identifying the second set of content to the first array;receiving at the caching server, a request for particular content duringthe second interval; serving the particular content from thenon-transitory computer-readable storage of the caching server when theparticular content is stored to the non-transitory computer-readablestorage; and serving the particular content from an origin server andcaching the particular content to the non-transitory computer-readablestorage when each index of the set of indices uniquely identifying theparticular content is entered in at least one of the first array and thesecond array.
 10. The computer-implemented method of claim 9 furthercomprising serving the particular content from an origin server withoutcaching it at the caching server when at least one index of the set ofindices uniquely identifying the particular content is not entered inthe first array and the second array.
 11. The computer-implementedmethod of claim 9 further comprising copying the sets of indices enteredto the first array during the second interval to the second array andclearing the first array at the end of the second interval.
 12. Thecomputer-implemented method of claim 11 further comprising trackingrequests for a third set of content received during a third interval asdifferent sets of indices entered to the first array, wherein the thirdinterval commences at the end of the second interval.
 13. Thecomputer-implemented method of claim 9 further comprising configuringthe caching server with at least one hashing function that generates aset of indices uniquely identifying content based on a URL used torequest that content.
 14. The computer-implemented method of claim 9,wherein each set of indices uniquely identifying content comprises afixed length array of indices with a specific combination of the indicesto distinctly identify that content from other content having differentcombinations of indices set for the fixed length array.